Feat/integration/ag UI - #40
Merged
Merged
Conversation
ssmrmmk
approved these changes
Jul 3, 2026
barlipdev
approved these changes
Jul 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds the AG-UI protocol adapter (
@mobile-reality/mdma-agui) and the runtime/renderer support needed to make MDMA documents fully interactive over an AG-UI agent, plus a backend-driven hydration path so re-opened conversations render pre-populated.Highlights:
createMdmaAgentBridge) plus a React layer (useMdmaAgentStream,MdmaAgentView). AG-UI coupling is isolated to a minimal structural agent interface.initialStatehydration — new option oncreateDocumentStoreto seed component values at store creation (e.g. restoring a persisted conversation fetched from a backend). Keyed by component id → itsvaluesmap (symmetric withgetState()), it overlays AST defaults without emitting audit events or marking fieldstouched, and applies only to freshly-created components so a streaming re-parse never clobbers in-flight edits. Threaded throughparseMdma, the bridge, andMdmaAgentView.ACTION_TRIGGERED(itsonCompleteaction) on the transition into all-items-checked; webhook renders a trigger button emittingINTEGRATION_CALLED.onActionmethods from the core attachable handlers (renderers dispatch store actions directly; the methods were unreachable).Type of Change
Packages Affected
@mobile-reality/mdma-spec@mobile-reality/mdma-parser@mobile-reality/mdma-runtime@mobile-reality/mdma-attachables-core@mobile-reality/mdma-renderer-react@mobile-reality/mdma-prompt-packChecklist
pnpm formatandpnpm lintpass).pnpm test).pnpm typecheck).pnpm changeset) if this change affects published packages.sensitive: truewhere appropriate.How to Test
pnpm install && pnpm buildpnpm --filter @mobile-reality/mdma-runtime --filter @mobile-reality/mdma-agui --filter @mobile-reality/mdma-renderer-react --filter @mobile-reality/mdma-attachables-core test(all green). CoversinitialStatehydration (values seeded, bindings resolve, no forged audit events, survivesupdateAst) and bridge routing of tasklist completion / webhookINTEGRATION_CALLED.pnpm --filter @mobile-reality/mdma-demo dev, open Docs → Usage → "Restoring State" → "Show live example →". In the right panel, click "Fetch saved state"; after ~2s the intake form in the agent message re-hydrates from the mock backend snapshot.<MdmaAgentView agent={httpAgent} />at an AG-UI agent that streams MDMA. Confirm: form submit / button / completing a tasklist / approve-deny / firing a webhook each resume the agent run; and passinginitialState={…}renders a re-opened conversation pre-populated.Screenshots / Examples
Restore a persisted conversation with a backend snapshot: